from kyb_caps import driver,By,sleep
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

#输入用户名密码
# 输入用户名，密码，点击登录
driver.find_element(By.ID,'com.tal.kaoyan:id/login_email_edittext').send_keys('wangjiacheng01')
driver.find_element(By.ID,'com.tal.kaoyan:id/login_password_edittext').send_keys('123456')
driver.find_element(By.ID,'com.tal.kaoyan:id/login_login_btn').click()

toast_loc=(By.XPATH,'//*[@text="用户名或密码错误，你还可以尝试2次"]')
ele_toast=WebDriverWait(driver,30,0.5).until(EC.presence_of_element_located(toast_loc))
print(ele_toast.text)
sleep(3)

driver.quit()